<template>
  <div>
      <DetailTop/>
      <div class="banner">
          <van-image :src="brand.list_pic_url">
            <template v-slot:loading>
                <van-loading type="spinner" />
            </template>
            </van-image>
          <h2>
            {{brand.name}}
          </h2>
      </div>

      <p>
        {{brand.simple_desc}}
      </p>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import DetailTop from '../../components/DetailTop.vue'
import {getBrand} from '@/api'
export default {
    name:'Brand',
    data() {
      return {
        brand:{}
      }
    },
    computed:{
      ...mapGetters(['brandList']),

    },
   created() {
    getBrand({
      id: this.$route.params.id,
    }).then((res) => {
        this.brand = res;
        console.log(this.brand);     
    })
  },
    components:{
        DetailTop
    }
}
</script>

<style lang = "less" scoped>
.banner {
  width: 100%;
  position: relative;
  img {
    display: block;
    width: 100%;
  }
  h2 {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    text-align: center;
    height: 30px;
    line-height: 30px;
    margin: auto;
    font-size: 20px;
    text-decoration: underline;
    color: #fff;
  }
}
p {
  background: #fff;
  font-size: 18px;
  text-align: center;
  padding: 20px 10px;
  line-height: 26px;
  color: #666;
}
</style>